from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_caching import Cache

config = {
    'CACHE_TYPE': 'redis',
    'CACHE_REDIS_DB': 3,
    'CACHE_REDIS_HOST': 'localhost',
    'CACHE_REDIS_PASSWORD': '',
}

db = SQLAlchemy()
migrate = Migrate()
cache = Cache(config=config)


def init_exts(app):
    db.init_app(app)
    migrate.init_app(app, db)
    cache.init_app(app)
